//
//  IManager+ModuleMerchantSubmitError.m
//  RocketProject
//
//  Created by Wu Chengwei on 13-9-20.
//  Copyright (c) 2013年 Rocket. All rights reserved.
//

#import "IManager+ModuleMerchantSubmitError.h"
#import "FrameworkRelativeDefines.h"
#import "NetUrlDefines.h"
#import "RequestUtlity.h"
#import "NSString+NSString_Ex_.h"
#import "TravelException.h"
#import "GloableEngineService.h"
#import "RCFeedbackDataModel.h"

@implementation IManager(ModuleMerchantSubmitError)

-(int64_t)requestSubmitError:(NSString *)merchantID withContent:(NSString *)content withEmail:(NSString *)email withDelegate:(id<IManagerDelegate>)delegate{
    if ([NSString stringIsNullOrEmpty:content] || [NSString stringIsNullOrEmpty:merchantID]) {
        return kInvalidRequestId;
    }
    if (nil == email) {
        email = @"";
    }
    NSMutableDictionary *postValue = [NSMutableDictionary dictionary];
    [postValue setObject:content forKey:@"content" withDefaultValue:@""];
    [postValue setObject:email forKey:@"email" withDefaultValue:@""];
    [postValue setObject:merchantID forKey:@"shopid" withDefaultValue:@""];
    [postValue setObject:[GloableEngineService sharedInstance].selectedCityID forKey:@"cityid" withDefaultValue:@""];
    [postValue setObject:[GloableEngineService sharedInstance].bduss forKey:@"bduss" withDefaultValue:@""];
    // 异步获取数据
    NSString *urlSuffix = kRCMerchantDetailSubmitErrorPrefix;
    NSString *url = [RequestUtlity getFormattedUrl:urlSuffix];
    
    KFLog(@"request url %@",url);
    return [[IDataProvider sharedInstance] asyncPostData:url postValues:postValue postDataList:nil userInfo:nil withDataParseClass:[RCFeedbackDataModel class] withDataDelegate:delegate];
}

@end
